cmake_minimum_required(VERSION 3.0)

project(balancer CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CXX_FLAGS
 -g
 -DCHECK_PTHREAD_RETURN_VALUE
 -D_FILE_OFFSET_BITS=64
 -Wall
 -Wextra
 -Werror
 -Wconversion
 -Wno-unused-parameter
 -Wold-style-cast
 -Woverloaded-virtual
 -Wpointer-arith
 -Wshadow
 -Wwrite-strings
 -march=native
 -std=c++11
 -rdynamic
 )

find_package(Boost REQUIRED)
# find_package(Protobuf)
find_package(CURL)
find_package(ZLIB)
if(NOT CMAKE_BUILD_TYPE)
  set(CMAKE_BUILD_TYPE "Release")
endif()

add_subdirectory(muduo/base)
add_subdirectory(muduo/net)

include_directories(${Boost_INCLUDE_DIRS})
include_directories(${PROJECT_SOURCE_DIR})
include_directories(utility)
include_directories(${PROJECT_SOURCE_DIR}/SMTPLibCurlWrapper/include)

add_subdirectory(balancer)
add_subdirectory(flow_inspector)

file(COPY ${PROJECT_SOURCE_DIR}/userlist.conf DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/balancer)

